feat(cat): implement GNU display flags (-A -b -e -E -s -t -T -v)#293
Merged
Conversation
Agent-Id: agent-b06ccde0-dadd-446a-8eb7-4da1a3a9a277 Linked-Note-Id: b2ce1141-e925-4ca2-9839-9929c05d6e05
Agent-Id: agent-cb21b343-b39f-4576-af13-6eca0dfea909 Linked-Note-Id: 2f16c18e-02bf-45f0-9c55-ea5a46c11175
Add show-nonprinting/-v byte table, show-ends, show-tabs, squeeze-blank, number-nonblank, long options, and -u no-op, matching GNU coreutils. Includes unit tests and locked comparison fixtures. Signed-off-by: Lars Trieloff <lars@trieloff.net>
|
@trieloff is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
cramforce
approved these changes
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full GNU coreutils
catdisplay-flag set. Previouslycatonly supported-n/--number(and advertised the others inflagsForFuzzingwithout wiring them in, socat -Aerrored).-A/--show-all-vET-b/--number-nonblank-n-e-vE-E/--show-ends$at end of each line-s/--squeeze-blank-t-vT-T/--show-tabs^I-v/--show-nonprinting^/M-notation (GNU byte table)-uDetails
cat.cbyte transformation for-vacross bytes 0–255 (control chars →^X, DEL →^?, high bytes →M-notation). Verified byte-for-byte against GNU coreutils 9.7.-A=-vET,-e=-vE,-t=-vT), combined short flags (-vET,-An,-bE), and long options.-boverrides-nand numbers only non-blank lines;-ssqueezes before numbering; per-line order is[number][transformed content][$ if -E][newline]; trailing partial line gets no$/newline.-n-only case.--helpupdated to list all flags; unknown flags still error.Tests
-vbyte table, aliases, combos, long options,-u, unknown-flag errors, multi-file numbering, no-trailing-newline).cat-show.comparison.test.tswith fixtures recorded against GNU coreutils cat 9.7, all entrieslocked: trueso BSD machines won't overwrite.pnpm test:comparison560/560 ·pnpm typecheck·pnpm lint:fix·pnpm knipall clean · cat suite 60/60.Scope is isolated to
packages/just-bash/src/commands/cat/plus one comparison-test file + fixtures.Pull Request opened by Augment Code with guidance from the PR author